package com.logic.modular.act.playerInfo;

import com.comment.util.message.ResponseResult;
import com.logic.comment.util.JwtUtils;
import com.logic.modular.game.statistical.domain.PlayerStatisticalPool;
import com.logic.modular.game.statistical.service.impl.PlayerStatisticalPoolServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 账户统计信息
 *
 * @author cxy
 * @since 2024-07-18 10:05:14
 */
@Api(tags = "账户统计信息")
@Validated
@RestController
@AllArgsConstructor
@RequestMapping("/playerStatisticalAct")
public class PlayerStatisticalAction {
    @Resource
    private PlayerStatisticalPoolServiceImpl playerStatisticalPoolService;

    @ApiOperation(value = "用户统计信息")
    @PostMapping("/statisticalPool")
    public ResponseResult<PlayerStatisticalPool> statisticalPool(@RequestHeader String token) {
        return ResponseResult.success("用户统计信息", playerStatisticalPoolService.obtain(JwtUtils.getPlayerId(token)));
    }
}
